package condition

import (
	"fmt"
)

func IfDo() {
	if true {
		fmt.Println("if condition is true")
	}
	var a int = 8
	if a < 20 {
		fmt.Println("a is less 8")
	} else {
		fmt.Println("a is lager 8")
	}
	var b int = 10

	if b < 100 {
		if b > 20 {
			fmt.Println("a is less than 100 and lager 20")
		} else {
			fmt.Println("a is less than 20")
		}
	}
	var marks int = 100

	var variable int = 100
	switch marks {
	case variable:
		fmt.Println("90")
	case 80:
		fmt.Println("80")
	default:
		fmt.Println("70")
	}

	switch {
	case marks >= 90:
		fmt.Println("90")
		fallthrough
	case marks >= 80:
		fmt.Println("80")
		//fallthrough
	default:
		fmt.Println("default")
	}

	var x interface{}
	switch x.(type) {
	case nil:
		fmt.Println("is nil")
	case string:
		fmt.Println("is string")
	case int:
		fmt.Println("int")
	default:
		fmt.Println("unknown")

	}

}
